package com.zjs.controller;

import com.zjs.pojo.User;
import com.zjs.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import util.ResultStatus;

@RestController
public class UserController {

    @Autowired
    private UserService userService;
    /**
     * 登录页面
     * @param
     * @return
     */
    @PostMapping("login")
    public ResultStatus Login(@RequestBody User user){
        return userService.Login(user);
    }

    /**
     * 获取验证码接口
     * @return
     */
    @PostMapping("getCode")
    public ResultStatus getCode(@RequestBody User user){
        return userService.getCode(user);
    }

    /**
     * 注册用户
     * @param
     * @return
     */
    @PostMapping("addUser")
    public ResultStatus addUser(@RequestBody User user){
        return userService.addUser(user);
    }

}
